#vertex --------------------------------
//mapping offset:COLOR2
attribute vec3 position:POSITION;
attribute vec3 normal:NORMAL;
attribute vec4 offset;
uniform mat4 game_MatrixVP:VP;
uniform mat4 game_MatrixM:M;
varying float alpha;
void main(void){
    alpha=offset.w;
    mat4 modelMat =game_MatrixM;
    vec3 pos=position;
    pos.xyz+=offset.xyz-normal*(1.-alpha)*0.2;
    vec4 wp=modelMat*vec4(pos,1.0);
    gl_Position = game_MatrixVP * wp;
   
}
#fragment ------------------------------
uniform vec4 gcolor:COLOR;
varying float alpha;
void main(void){
    vec4 baseColor=vec4(0.2,0.2,0.2,0.4*alpha+0.4);
    gl_FragColor = baseColor;
}
